package com.awanp3.nimbus.base.dubbo;

import com.awanp3.nimbus.base.api.RemoteCompanyService;
import com.awanp3.nimbus.base.api.domain.vo.RemoteCompanyVo;
import com.awanp3.nimbus.base.domain.bo.BaseCompanyBo;
import com.awanp3.nimbus.base.domain.vo.BaseCompanyVo;
import com.awanp3.nimbus.base.service.IBaseCompanyService;
import com.awanp3.nimbus.common.core.utils.MapstructUtils;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 公司远程服务
 *
 * @author 20014170
 */
@RequiredArgsConstructor
@Service
@DubboService
public class RemoteCompanyServiceImpl implements RemoteCompanyService {

    private final IBaseCompanyService baseCompanyService;

    /**
     * 查询公司列表
     *
     * @return 公司列表
     */
    @Override
    public List<RemoteCompanyVo> queryList() {
        List<BaseCompanyVo> list = baseCompanyService.queryList(new BaseCompanyBo());
        return MapstructUtils.convert(list, RemoteCompanyVo.class);
    }
}
